<template>
  <div style="display: flex">
    <div style="width: 66%"></div>
    <div style="width: 33%">
      <div style="display: flex">
        <div></div>
        <div style="width: 100%">
          <t-btn-group
            ref="btngroup"
            :staticItems="items"
            btnSpace="8px"
            :moreConf="true"
            :moreMaxCount="5"
            :autoModel="true"
            @btnGroupItemClick="btnGroupItemClick"
            tabIndex="1"
            moreBtnLable="高级设置"
          />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { onMounted, ref } from 'vue';
const btngroup = ref();
onMounted(() => {});
const btnGroupItemClick = function (val) {
  btngroup.value.setVisibleByIndex(2, false);
  console.log(val);
};
const items = [
  {
    code:'save',
    label: '保存',
    text: '',
    value: '1',
    icon: '',
    type: 'primary',
    hint: '保存...',
    visible: true,
    disabled: false,
  },
  {
    label: '另存为',
    text: '另存为',
    value: '2',
    icon: 'map',
    type: 'icon',
    hint: '另存为...',
    visible: true,
    disabled: false,
    showIcon:true
  },
  {
    label: '保存·发布',
    text: '保存·发布',
    value: '3',
    icon: '',
    type: '',
    hint: '保存并发布...',
    visible: true,
    disabled: false,
  },
  {
    label: '编辑',
    text: '编辑',
    value: '4',
    icon: '',
    type: '',
    hint: '保存...',
    visible: true,
    disabled: false,
  },
  {
    label: '删除',
    text: '删除',
    value: '5',
    icon: '',
    type: '',
    hint: '另存为...',
    visible: true,
    disabled: false,
  },
  {
    label: '复制',
    text: '复制',
    value: '6',
    icon: '',
    type: '',
    hint: '保存并发布...',
    visible: true,
    disabled: false,
  },
  {
    label: '更新',
    text: '更新',
    value: '7',
    icon: '',
    type: '',
    hint: '保存并发布...',
    visible: true,
    disabled: false,
  },
  {
    label: '新增',
    text: '新增',
    value: '8',
    icon: '',
    type: '',
    hint: '保存并发布...',
    visible: true,
    disabled: false,
  },
  {
    label: '你好',
    text: '你好',
    value: '9',
    icon: '',
    type: '',
    hint: '保存并发布...',
    visible: true,
    disabled: false,
  },
];
</script>
